<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>作业1</title>
		<style type="text/css">
			* {
				margin: 0;
				padding: 0;
			}
			.box {
				width: 1000px;
				height: 300px;
				border: 2px solid red;
				margin: 50px auto 0;
				position: relative;
				/* overflow: hidden; */
			}
			.box>div {
				width: 400px;
				height: 60px;
				font-size: 40px;
				display: flex;
				justify-content: center;
				align-items: center;
				background-color: lightblue;
				position: absolute;
				left: -400px;
				top: 0;
				bottom: 0;
				margin: auto 0;
			}
		</style>
	</head>
	<body>
		<div class="box">
			<div>我是祥铭的爸爸~~!!</div>
		</div>
		<script type="text/javascript">
			var xmFather = document.querySelector(".box>div");
			var offsetL = -400;
			setInterval(function(){
				offsetL+=3;
				xmFather.style.left = offsetL + "px";
				if(offsetL >= 1000) {
					offsetL = -400;
				}
			}, 20);
		</script>
	</body>
</html>
